$(function(){
	
	if($.browser.msie){
		
		if(navigator.userAgent.indexOf("MSIE 10.0")>0){
			return;	
		}
		if(navigator.userAgent.indexOf("MSIE 9.0")>0){
			return;	
		}
		
		// 针对IE 7 8 
		var _transactions = $('.tc-detail-list li');
		for(var i=0,ln=_transactions.length;i<ln;i++){
			if(i%2 == 0){
				_transactions.eq(i).css('background','#f0f5ff');
			}else{
				_transactions.eq(i).css('background','#dde8ff');
			}	
		}
	}
	
	var navBar = $('.back-up'),
		menu = $('.nav-list li');
		navWidth = menu.width(),
		lastIndex = 0;
	menu.each(function(){
		var me = $(this),
			index = me.index();
		
		me.mouseenter(function(){
			menu.find('a').css('color','black');

			me.find('a').css('color','#ff6600');
				menu.siblings('.active').find('a').css('color','#ff6600');
			if(index == lastIndex){
				return;	
			}
			if(index>lastIndex){
				navBar.animate({'left':(index*navWidth+10)},250,'linear',function(){
					navBar.animate({'left':index*navWidth},100);
					lastIndex = index;
					return;
				});
			}
			if(index<lastIndex){
				navBar.animate({'left':(index*navWidth-10)},250,'linear',function(){
					navBar.animate({'left':index*navWidth},100);
					lastIndex = index;
					return;
				});
			}
		});	
	});	
	
	
	$('.transaction-list li').each(function(){
		var me = $(this);
		me.click(function(){
			me.addClass('active');
			me.siblings().removeClass('active')	
		});	
	});
	
	$('.tc-list li').each(function(){
		var me = $(this);
		me.click(function(){
			me.addClass('active');
			me.siblings().removeClass('active')	
		});	
	});
});